/*
 * @file arma_printf.h
 *
 * Use printf to print ARMA matrices
 *
 * @author Dahua Lin
 */

#ifndef _MSC_VER
#pragma once
#endif

#ifndef GMLPP_ARMA_PRINTF_H_
#define GMLPP_ARMA_PRINTF_H_

#include "arma_base.h"
#include <cstdio>

namespace gml
{

	template<typename T>
	void printf_mat(const Mat<T>& X, const char *fmt,
			const char *prefix=nullptr, const char *suffix="\n")
	{
		for (uword i = 0; i < X.n_rows; ++i)
		{
			if (prefix) std::printf("%s", prefix);
			for (uword j = 0; j < X.n_cols; ++j)
			{
				std::printf(fmt, X(i, j));
			}
			std::printf("%s", suffix);
		}
	}
}


#endif /* ARMA_PRINTF_H_ */
